import { h, init } from 'snabbdom'

const patch = init([])

let vnode = h('div#container', [
  h('h1', 'hello Snabbdom'),
  h('p', '这是一个p标签')
])

let app = document.querySelector('#app')

let oldVnode = patch(app, vnode)

setTimeout(()=>{
  vnode = h('div#container', [
    h('h1','Hello World'),
    h('p', 'Hello P')
  ])
  patch(oldVnode, vnode)

  setTimeout(() => {
    patch(oldVnode, h('!'))
  }, 1000 * 2)
}, 1000 * 2)
